//Create Fake Combobox
function FakeComboBox(vWidth, vLeft, vRight, titles,functions) {
	var self = Titanium.UI.createView({
        backgroundColor: 'transparent',
    });    
    
    
    // Create a TableView.
    var tblComboBox = Ti.UI.createTableView();
    tblComboBox.left = vLeft;
    tblComboBox.width = vWidth - vLeft - vRight;
    tblComboBox.height = titles.length * 44;
    tblComboBox.top = 0;
    tblComboBox.backgroundColor = 'yellow';
    // Populate the TableView data.
    
    var data = new Array();
    for(var i = 0; i < titles.length; i++)
    {
    	data[i] = {title: titles[i], funcId: functions[i]};
    }
    tblComboBox.setData(data);
    
    // Listen for click events.
    tblComboBox.addEventListener('click', function(e) {
    	Ti.API.info(e);
        self.fireEvent('chooseComboBox',{info : titles[e.index], funcId: functions[e.index]});
    });
    
    // Add to the parent view.
    self.add(tblComboBox);
    
	return self;
}
module.exports = FakeComboBox;